import Vue from 'vue'
import Router from 'vue-router'
import Home from './views/Home.vue'
import Goods from './views/goods.vue'
import Ratings from './views/ratings.vue'
import Seller from './views/seller.vue'
import Food from './views/food.vue'

Vue.use(Router)

export default new Router({
  mode: 'history',
  base: process.env.BASE_URL,
  linkActiveClass:'active',
  routes: [
    {
      path: '/',
      name: 'home',
      component: Home,
      redirect:'good',
      children:[
        {
          path: 'good',
          name: 'good',
          component: Goods
        },
        {
          path: 'seller',
          name: 'seller',
          component: Seller
        },
        {
          path: 'rating',
          name: 'rating',
          component: Ratings
        }
      ]
    },
    {
      path: '/food',
      name: 'food',
      // route level code-splitting
      // this generates a separate chunk (about.[hash].js) for this route
      // which is lazy-loaded when the route is visited.
      component: Food
    }
  ]
})
